<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>
   		<f:viewParam name="serviceSupplierId" value="#{ejbServiceSupplierHome.id}"></f:viewParam>	   	
	   	<f:event listener="#{ejbServiceSupplierHome.initConversation()}" type="preRenderView"></f:event>
	   	<f:viewParam name="moduleName" value="重关联服务事项"></f:viewParam>
   	</f:metadata>
    
    
   	<ui:define name="content">
   
		<h:form id="editForm">         
	        <p:messages id="messages" closable="true">
	       		<p:autoUpdate />
	       	</p:messages>
   			<p:panel id="baseInfo" header="修改中介用户" style="margin-bottom:10px;">		        
		        <h:panelGrid columns="2" cellpadding="5">
		        	<p:outputLabel						
						value="公司名称"
					/>
					<h:outputText						
						value="#{ejbServiceSupplierHome.instance.cnname}"						
					/>
				</h:panelGrid>
			</p:panel>
			
			<p:panel
				id="businesses"
				header="主营业务"
				style="margin-bottom:10px;"
				styleClass="nureg-cont nuregcbox nuregcboxsty"
			>
				<c:forEach
					items="#{ejbServiceSupplierHome.instance.mainBusinesses}"
					var="_business"
					varStatus="_status"
				>
					<div class="certs">
						<h2>主营业务#{_status.index + 1}</h2>

						<h:panelGrid
							columns="2"
							cellpadding="5"
						>
							<p:outputLabel
								value="服务事项"
							/>
							<h:outputText value="#{_business.agentServiceDetail}" />
							
							<p:outputLabel
								value="已有服务事项关联"
							/>
							<h:outputText value="#{_business.agentService.name}" />
						</h:panelGrid>
					</div>
				</c:forEach>
			</p:panel>
			
			<p:panel>
				<p:dataTable value="#{ftAgentServiceList.resultList}" var="_agentService" rowIndexVar="_rowIndex">
					<p:column headerText="序号" width="40" style="text-align: center;">
						#{_rowIndex + 1}
					</p:column>
					<p:column headerText="ID">
						<h:outputText value="#{_agentService.id}" />
					</p:column>
					<p:column headerText="服务事项名称">
						<h:outputText value="#{_agentService.highLightTitle}" escape="false" />
					</p:column>
					<p:column headerText="对应资质分类">
						<h:outputText value="#{_agentService.qualificationClass.name}" escape="false" />
					</p:column>
					<p:column headerText="操作" width="100" style="text-align: center;">
						<p:commandButton
							action="#{ejbServiceSupplierHome.addAgentService(_agentService)}"
							value="添加"
							update="@form"
						></p:commandButton>
					</p:column>
				</p:dataTable>
			</p:panel>
			
			<p:commandButton action="#{ejbServiceSupplierHome.save()}" value="保存" oncomplete="window.close();"></p:commandButton>
			<p:commandButton action="#{ejbServiceSupplierHome.cancel()}" value="取消" oncomplete="window.close();" immediate="true"></p:commandButton>
	   	</h:form>
      
   	</ui:define>
</ui:composition>
 